url = '/'
title = '首页'
layout = 'default'
==


{% partial 'common/index' %}

{% put scripts %}
<script>
    var indexMuneTop =  $("#indexListUlMune").offset().top; // indexMuneTop
    window.onscroll = function () {
        /**/
        var top = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
        if (top > indexMuneTop) {
            $("#indexListUlMune").addClass("fixedMune").css("top",$(".logoBox").outerHeight())
        } else if (top < indexMuneTop) {
            $("#indexListUlMune").removeClass("fixedMune").removeAttr("style");

        }
        if (top > 300) {
            $(".goTop").show(200);
        } else {
            $(".goTop").hide(200);
        }

    }; 
    /******************new***/
    var mySwiper5 = new Swiper('#indexListUlMune ', {
        freeMode: true,
        freeModeMomentumRatio: 0.5,
        slidesPerView: 'auto',

    });
    swiperWidth = mySwiper5.container[0].clientWidth
    maxTranslate = mySwiper5.maxTranslate();
    maxWidth = -maxTranslate + swiperWidth / 2
    $("#indexListUlMune").on('touchstart', function(e) {
        e.preventDefault()
    })

    mySwiper5.on('tap', function(swiper, e) {
        e.preventDefault()
        slide = swiper.slides[swiper.clickedIndex]
        slideLeft = slide.offsetLeft
        slideWidth = slide.clientWidth
        slideCenter = slideLeft + slideWidth / 2
        // 被点击slide的中心点
        mySwiper5.setWrapperTransition(300)
        if (slideCenter < swiperWidth / 2) {
            mySwiper5.setWrapperTranslate(0)
        } else if (slideCenter > maxWidth) {
            mySwiper5.setWrapperTranslate(maxTranslate)
        } else {
            nowTlanslate = slideCenter - swiperWidth / 2
            mySwiper5.setWrapperTranslate(-nowTlanslate)
        }
        $("#indexListUlMune .active").removeClass('active')
        $("#indexListUlMune .swiper-slide").eq(swiper.clickedIndex).addClass('active')
        $(".indexListUlBox .listUl").eq(swiper.clickedIndex).addClass("active").siblings().removeClass("active");
        $('body,html').animate({scrollTop:$(".index_content").offset().top-$(".logoBox").outerHeight()},100);
    })

</script>
{% endput %}
<script type="text/javascript">
    var google_tag_params = {
        ecomm_prodid: "",
        ecomm_pagetype: "home",
        ecomm_totalvalue:"",
    };
</script>